package org.test.myTree.AbstractTree;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;
import org.test.common.Context;
import org.test.dao.ITbDepartmentDAO;


@Repository("treeServiceImpl")
public class TreeServiceImpl implements ITreeService{
	
	@Resource(name = "tbDepartmentDAO")
	private ITbDepartmentDAO tbDepartmentDAO;

	
	
	/**
	 * 把树从新从内存中加载
	 */
	public void updateTree() {
		 EmergencyTree.updateEmergencyTree(tbDepartmentDAO);
	}
	
	/**
	 * 得到emegencyTree
	 * @return
	 */
	public EmergencyTree queryEmergencyTree(){
		EmergencyTree tree = EmergencyTree.getInstance(tbDepartmentDAO);
		return tree;
	}
}
